﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PictrueSimpleSyndication
{
    /// <summary>
    /// 包含内容信息
    /// </summary>
    public class ContentInfo
    {
        /// <summary>
        /// 内容标识
        /// </summary>
        public string Identification { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        public string Describe { get; set; }

        /// <summary>
        /// 数据内容信息
        /// </summary>
        public string DataInfo { get; set; }

        /// <summary>
        /// 数据
        /// </summary>
        public object Data { get; set; }

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public T GetData<T>()
        {
            if (Data != null && Data is T)
                return (T)Data;

            return default(T);
        }
    }

    public interface IDataContent
    {
        IEnumerable<ContentInfo> GetAllContentInfo();
    }
}
